      SUBROUTINE SETUP
      RETURN
      END
C   HS117
      SUBROUTINE EF(X,FX)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX),B17(10),G17(5,5),D17(5),S,FX
      SAVE B17,D17,G17
      DATA B17/-40.D0,-2.D0,-.25D0,-4.D0,-4.D0,-1.D0,-40.D0,-60.D0
     1        ,5.D0,1.D0/
      DATA G17/30.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,39.D0,-6.D0
     1        ,-31.D0,32.D0,-10.D0,-6.D0,10.D0,-6.D0,-10.D0,32.D0,
     2 -31.D0,-6.D0,39.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,30.D0/
      DATA D17/4.D0,8.D0,10.D0,6.D0,2.D0/
      ICF=ICF+1
      S=0.D0
      DO      200      I=1,5
      DO      100      J=1,5
      S=S+G17(I,J)*X(I)*X(J)
  100 CONTINUE
      S=S+D17(I)*X(I)**3*2.D0
  200 CONTINUE
      DO      300      I=6,15
      S=S-B17(I-5)*X(I)
  300 CONTINUE
      FX=S
      RETURN
      END
      SUBROUTINE EGRADF(X,GRADF)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX),GRADF(NX),B17(10),G17(5,5),D17(5),S
      SAVE B17,D17,G17
      DATA B17/-40.D0,-2.D0,-.25D0,-4.D0,-4.D0,-1.D0,-40.D0,-60.D0
     1        ,5.D0,1.D0/
      DATA G17/30.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,39.D0,-6.D0
     1        ,-31.D0,32.D0,-10.D0,-6.D0,10.D0,-6.D0,-10.D0,32.D0,
     2 -31.D0,-6.D0,39.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,30.D0/
      DATA D17/4.D0,8.D0,10.D0,6.D0,2.D0/
      ICGF=ICGF+1
      DO      300      I=1,15
      IF(I .GT. 5)      GOTO 200
      GRADF(I)=6.D0*D17(I)*X(I)**2
      S=0.D0
      DO      100      J=1,5
      S=S+G17(I,J)*X(J)
  100 CONTINUE
      GRADF(I)=(GRADF(I)+2.D0*S)
      GOTO 300
  200 CONTINUE
      GRADF(I)=-B17(I-5)
  300 CONTINUE
      RETURN
      END
      SUBROUTINE EH(I,X,HXI)
      INCLUDE 'FUCO.INC'
      INTEGER I
      DOUBLE PRECISION X(NX),HXI
      CRES(I)=CRES(I)+1
      RETURN
      END
      SUBROUTINE EGRADH(I,X,GRADHI)
      INCLUDE 'FUCO.INC'
      DOUBLE PRECISION X(NX),GRADHI(NX)
      INTEGER I
      CGRES(I)=CGRES(I)+1
      RETURN
      END
      SUBROUTINE EG(I,X,GXI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX),B17(10),G17(5,5),D17(5),E17(5),A17(10,5)
      DOUBLE PRECISION GXI,S
      SAVE G17,D17,E17,A17,B17
      DATA G17/30.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,39.D0,-6.D0
     1        ,-31.D0,32.D0,-10.D0,-6.D0,10.D0,-6.D0,-10.D0,32.D0,
     2 -31.D0,-6.D0,39.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,30.D0/
      DATA D17/4.D0,8.D0,10.D0,6.D0,2.D0/
      DATA E17/-15.D0,-27.D0,-36.D0,-18.D0,-12.D0/
      DATA A17/-16.D0,0.D0,-3.5D0,0.D0,0.D0,2.D0,-1.D0,-1.D0,2*1.D0,
     1        2.D0,-2.D0,0.D0,-2.D0,-9.D0,0.D0,-1.D0,-2.D0,2.D0,1.D0,
     2     2*0.D0,2.D0,0.D0,-2.D0,-4.D0,-1.D0,-3.D0,3.D0,1.D0,
     3     1.D0,.4D0,0.D0,-4.D0,1.D0,0.D0,-1.D0,-2.D0,4.D0,1.D0,
     4     0.D0,2.D0,0.D0,-1.D0,-2.8D0,0.D0,-1.D0,-1.D0,5.D0,1.D0/
      IF ( GUNIT(1,I+NH) .EQ. -1 )CRES(I+NH)=CRES(I+NH)+1      
      IF( I .GT. 5)      GOTO 300
      S=0.D0
      DO      100      J=1,10
      S=S-A17(J,I)*X(J+5)
  100 CONTINUE
      DO      200      J=1,5
      S=S+2.D0*G17(J,I)*X(J)
  200 CONTINUE
      GXI=(E17(I)+3.D0*D17(I)*X(I)**2+S)
      RETURN
  300 CONTINUE
      GXI=X(I-5)
      RETURN
      END
      SUBROUTINE EGRADG(I,X,GRADGI)
      INCLUDE 'FUCO.INC'
      INTEGER I,J
      DOUBLE PRECISION X(NX),GRADGI(NX),G17(5,5),D17(5),
     1         A17(10,5)
      SAVE G17,A17,D17
      DATA G17/30.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,39.D0,-6.D0
     1        ,-31.D0,32.D0,-10.D0,-6.D0,10.D0,-6.D0,-10.D0,32.D0,
     2 -31.D0,-6.D0,39.D0,-20.D0,-10.D0,32.D0,-10.D0,-20.D0,30.D0/
      DATA D17/4.D0,8.D0,10.D0,6.D0,2.D0/
      DATA A17/-16.D0,0.D0,-3.5D0,0.D0,0.D0,2.D0,-1.D0,-1.D0,2*1.D0,
     1        2.D0,-2.D0,0.D0,-2.D0,-9.D0,0.D0,-1.D0,-2.D0,2.D0,1.D0,
     2     2*0.D0,2.D0,0.D0,-2.D0,-4.D0,-1.D0,-3.D0,3.D0,1.D0,
     3     1.D0,.4D0,0.D0,-4.D0,1.D0,0.D0,-1.D0,-2.D0,4.D0,1.D0,
     4     0.D0,2.D0,0.D0,-1.D0,-2.8D0,0.D0,-1.D0,-1.D0,5.D0,1.D0/
      IF ( GUNIT(1,I+NH) .EQ. 1 )RETURN
      CGRES(I+NH)=CGRES(I+NH)+1
      IF( I .GT. 5)      GOTO 300
      DO      100      J=1,15
      IF(J .LE. 5)      GRADGI(J)=2.D0*G17(J,I)
      IF(J .GT. 5)      GRADGI(J)=-A17(J-5,I)
  100 CONTINUE
      GRADGI(I)=GRADGI(I)+6.D0*D17(I)*X(I)
      RETURN
  300 CONTINUE
      DO      400      J=1,15
      GRADGI(J)=0.D0
  400 CONTINUE
      GRADGI(I-5)=1.D0
      RETURN
      END
      BLOCK DATA
      INCLUDE 'BLOCO.INC'
      INTEGER I,J
      DATA NAME/'HS117'/
C     DATA X/11*1.D-4,60.D0,3*1.D-4,35*0.D0/
      DATA (X(I),I=1,15)/6*1.D-3,60.D0,8*1.D-3/
      DATA N/15/ , NH/0/ , NG/20/
      DATA DEL0/1.00D0/ ,TAU0/1.00D0/ ,TAU/.1D0/
      DATA ((GUNIT(I,J),I=1,3),J=0,20)
     F           /-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,
     F           1,1,1,1,2,1,1,3,1,1,4,1,1,5,1,1,6,1,1,7,1,1,8,1,
     F           1,9,1,1,10,1,1,11,1,1,12,1,1,13,1,1,14,1,1,15,1/
      END
